package com.yonyou.cyxdms.sysAuth.service.dto.user;

import com.yonyou.cyx.framework.bean.dto.base.BaseDTO;
import com.yonyou.cyx.framework.bean.entity.base.BasePO;
import com.yonyou.cyx.function.utils.bean.BeanMapperUtil;
import com.yonyou.cyx.function.utils.jsonserializer.JSONUtil;

import java.io.Serializable;

/**
 * <p>
 * 账号信息
 * </p>
 *
 * @author zhangxianchao
 * @since 2018-09-13
 */

public class UserDTO extends BaseDTO implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 账号ID
     */
    private Long userId;
    /**
     * 租户Code
     */
    private String appId;
    /**
     * 员工ID
     */
    private Long empId;
    /**
     * 作为登陆的ID
     */
    private String userCode;
    private String password;
    /**
     * 停用，起用(暂时保留)
     */
    private Integer userStatus;

    /**
     * 最后登录时间
     */
    private String loginLastTime;
    /**
     * 停用日期
     */
    private String stopDate;
    /**
     * 来源日期
     */
    private String sourceChangedAt;
    /**
     * 经销商id
     */
    private Long orgId;
    /**
     * 经销商代码
     */
    private String dealerCode;
    private Integer userType;
    private String lockCause;

    public String getLockCause() {
        return lockCause;
    }

    public void setLockCause(String lockCause) {
        this.lockCause = lockCause;
    }

    public UserDTO() {
        super();
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getAppId() {
        return appId;
    }

    public void setAppId(String appId) {
        this.appId = appId;
    }

    public Long getOrgId() {
        return orgId;
    }

    public void setOrgId(Long orgId) {
        this.orgId = orgId;
    }

    public Integer getUserType() {
        return userType;
    }

    public void setUserType(Integer userType) {
        this.userType = userType;
    }

    public Long getUserId() {
        return userId;
    }


    public void setUserId(Long userId) {
        this.userId = userId;
    }


    public Long getEmpId() {
        return empId;
    }


    public void setEmpId(Long empId) {
        this.empId = empId;
    }


    public String getUserCode() {
        return userCode;
    }


    public void setUserCode(String userCode) {
        this.userCode = userCode;
    }


    public Integer getUserStatus() {
        return userStatus;
    }


    public void setUserStatus(Integer userStatus) {
        this.userStatus = userStatus;
    }


    public String getDealerCode() {
        return dealerCode;
    }

    public void setDealerCode(String dealerCode) {
        this.dealerCode = dealerCode;
    }

    public String getLoginLastTime() {
        return loginLastTime;
    }

    public void setLoginLastTime(String loginLastTime) {
        this.loginLastTime = loginLastTime;
    }

    public String getStopDate() {
        return stopDate;
    }

    public void setStopDate(String stopDate) {
        this.stopDate = stopDate;
    }

    public String getSourceChangedAt() {
        return sourceChangedAt;
    }

    public void setSourceChangedAt(String sourceChangedAt) {
        this.sourceChangedAt = sourceChangedAt;
    }

    @Override
    public String toString() {
        return JSONUtil.objectToJson(this);
    }

    /**
     * 将DTO 转换为PO
     *
     * @param poClass dto 需要转换的dto
     * @author zhangxianchao
     * @since 2018/7/22 0022
     */
    @Override
    public <T extends BasePO> T transDtoToPo(Class<T> poClass) {
        return super.transDtoToPo(poClass);
    }

    /**
     * 将DTO 转换为PO
     *
     * @param po 需要转换的对象
     * @author zhangxianchao
     * @since 2018/7/22 0022
     */
    public <T extends BasePO> void transDtoToPo(T po) {
        BeanMapperUtil.copyProperties(this, po, "userId");
    }

}
